use Dosvid
go

create TRIGGER Candidate_Resume_UTrig ON Candidate_Resume AFTER UPDATE
AS 
BEGIN
  if @@rowcount = 0 return	 

  if Update(Resume) begin
    update c set
      c.DLC = convert(datetime,convert(varchar,getdate(),102))
    from Candidates c
    join inserted i on c.Id = i.CandidateID
  end

END
GO


create TRIGGER Candidate_Resume_ITrig ON Candidate_Resume AFTER insert
AS 
BEGIN
  if @@rowcount = 0 return	 

  update c set
    c.DLC = convert(datetime,convert(varchar,getdate(),102))
  from Candidates c
  join inserted i on c.Id = i.CandidateID
END
GO
